home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / networking / 3164 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  5.3 KB

  1. Path: comma.rhein.de!serpens!not-for-mail
  2. From: mlelstv@serpens.rhein.de (Michael van Elst)
  3. Newsgroups: comp.sys.amiga.networking
  4. Subject: Re: Announce: AWeb 1.0 released!
  5. Date: 29 Mar 1996 11:19:39 +0100
  6. Organization: dis-
  7. Message-ID: <4jgdfr$8f4@serpens.rhein.de>
  8. References: <4iva78$5pa@news.xs4all.nl> <4j1f6e$984@news.uni-c.dk> <jasonb.827822336@cs.uwa.edu.au> <4j8o6r$9vj@serpens.rhein.de> <jasonb.827896888@cs.uwa.edu.au> <4jaue8$jh4@serpens.rhein.de> <jasonb.827996764@cs.uwa.edu.au> <4je3qj$kk@serpens.rhein.de> <jasonb.828076494@cs.uwa.edu.au>
  9. NNTP-Posting-Host: serpens.rhein.de
  10.  
  11. jasonb@cs.uwa.edu.au (Jason S Birch) writes:
  12.  
  13. >AmFTP for examples of this. As a side effect, because MUI doesn't show
  14. >a button being depressed unless it is also about to process it, those
  15. >applications also give an immediate response to those events.
  16.  
  17. Sounds really useful if the button doesn't react.
  18.  
  19. >This is
  20. >in contrast to AWeb, which *does* show the button being depressed
  21. >immediately, but the actual processing of the event can take a second
  22. >or two, so it feels sluggish.
  23.  
  24. What would you think about a keyboard where the keys are stuck until
  25. a program reads from the keyboard ?
  26.  
  27. Obviously you want to be able to press keys on the keyboard and you
  28. accept that the characters might appear _a little later_. Same with
  29. gadgets and mouseclicks. The problem is one of _time_. You expect
  30. some things to happen immediately, other things are acceptable when
  31. delays for a fraction of a second, other things are allowed to take
  32. seconds, minutes, hours, whatever. The trick is to provide appropriate
  33. feedback.
  34.  
  35. And with the gadgets running completely on the user process you cannot
  36. provide the feedback all the time. It depends on how fast your machine
  37. is, how much work your program has to do and wether other _user
  38. processes_ are using up CPU time.
  39.  
  40. It is much simpler to provide timely feedback if the user interface
  41. runs at a higher priority. And that's what the Amiga and Intuition
  42. does, it has a user interface process run by input.device.
  43.  
  44. Obviously this has a disadvantage since many user interfaces also
  45. perform low priority actions. So you need at least part of the interface
  46. running on the high priority process and offload part of the interface
  47. to a low priority task. This can be a new task (but which possibly
  48. needs complex locking of data structures) or the user program (but which
  49. might interfere with long term calculations).
  50.  
  51. >Obviously, because of the way MUI works, a program written in exactly
  52. >the same way AWeb has been, but using MUI instead, would be even
  53. >worse, because the buttons themselves wouldn't depress for a second or
  54. >two. The point is (good) programmers don't program in MUI in the same
  55. >way. They use a subtask or put the application to sleep.
  56.  
  57. And they have to raise the priority of the user interface to be safe
  58. against other user processes. Usuability of the user interfaces and
  59. other real-time tasks now becomes the policy of individual programs
  60. and their programmers.
  61.  
  62. >*rendering* to be done concurrently, just as long as they're done
  63. >concurrently at a lower priority than the main application's event
  64. >handling loop.
  65.  
  66. With the standard Exec scheduler you can even allow it to run on
  67. the same priority. The maximum latency (assuming that the UI doesn't
  68. need more than one timeslice) is the number of processes that run
  69. concurrently multiplied by the length of the timeslice. With the
  70. current timeslice value it should be reasonable to have 3 or 4 other
  71. process with little influence on the event handling. For many event
  72. types you can even allow larger delays but that's probably not
  73. acceptable for something like a scrollbar (assuming that the event
  74. handler has to cause updates to the display).
  75.  
  76. >would then be simply waiting for user input -- would quite naturally
  77. >get a higher priority.
  78.  
  79. But the event handling is already done at a higher priority. What you
  80. want to do is to do some dummy event handling at priority 20 and then
  81. the real event handling at priority 0 (where it has to compete with
  82. other user tasks because not everyone wants to adapt his programs to
  83. not interfere with MUI).
  84.  
  85. >Executive dynamically adjusts the priorities every second so that, over
  86. >time, several CPU-intensive tasks (originally at the same priority)
  87. >will indeed get equal amounts of CPU time.
  88.  
  89. That would mean that Executive always keeps the processes at the same
  90. priority. Obviously it doesn't do this and the timeslice of 1 second
  91. is probably too long.
  92.  
  93. >Non-CPU intensive tasks
  94. >are automatically raised in priority, because they are not using as
  95. >much CPU.
  96.  
  97. And how would you handle processes that need a lot of CPU and are
  98. scheduled a lot ?
  99.  
  100. >All it would take would be for the main event-handling task of AWeb
  101. >not to do any heavy processing (it currently appears to do page
  102. >layouts).
  103.  
  104. So we now have to write our programs to make MUI happy and have
  105. to write programs to make Executive happy. Isn't this the wrong way.
  106.  
  107. >big page is being layed out, and it's taking up an awful lot of CPU.
  108.  
  109. awful ? because it doesn't keep Executive happy ?
  110.  
  111. >>I can't see that MUI feels responsive when I click on a gadget and
  112. >>do not get any feedback.
  113.  
  114. >You've experienced this with one of the three apps I mentioned above?
  115.  
  116. Yes. And no, I do not run Executive anymore.
  117.  
  118. Regards,
  119. -- 
  120.                                 Michael van Elst
  121.  
  122. Internet: mlelstv@serpens.rhein.de
  123.                                 "A potential Snark may lurk in every tree."
  124.